# -*- coding: utf-8 -*-
# @Author   : Claus
# @Time     : 2020/6/21 16:51
# @FileName : Person.py

class Person:
    def __init__(self, name, age, sex, power=0):
        if str(sex) not in "10":
            print("第三个参数错误, 请重试")
            return
        else:
            if sex == 1:
                sex = "男"
            else:
                sex = "女"
        self.__name = name
        self.__age = age
        self.__sex = sex
        self.__power = power

    def check(self):
        if self.__power == 1:
            return 1
        else:
            return 0

    def set_name(self, value):
        if self.check():
            self.__name = value
            print(f"name属性修改成功 --> {value}")
        else:
            print("无权限修改姓名")

    def set_age(self, value):
        if self.check():
            self.__a = value
            print(f"age属性修改成功 --> {value}")
        else:
            print("无权限修改年龄")

    def set_sex(self, value):
        if self.check():
            self.__sex = value
            print(f"sex属性修改成功 --> {value}")
        else:
            print("无权限修改性别")

    def get_name(self):
        return self.__name

    def get_age(self):
        return self.__age

    def get_sex(self):
        return self.__sex


if __name__ == '__main__':
    person = Person("Thoams", 18, 1)
    print(person.get_sex())
    person.set_age(20)
    person2 = Person("mark", 22, 1, 1)
    person2.set_name("claus")
    print(person2.get_name())
    person3 =  Person("perter", 19, 0)
    print(person3.get_sex())
    a = "python" + 3
    print(3+"1")